<?php
namespace Admin\Model;
use Think\Model;
class PaymentModel extends Model {
	public function getlist(){
		$page=I("p",1,"int");
		$info=$this->where('payment=1')->page($page.',25')->select();
		$count=$this->where('payment=1')->count();
		$Page=new\Think\Page($count,25);
		$Page->setConfig('header','<div >共<span>%TOTAL_ROW%</span>条&nbsp;&nbsp;第<span>%NOW_PAGE%</span>页/共<span>%TOTAL_PAGE%</span>页</div>');
		$Page->setConfig('theme','%HEADER% %FIRST% %UP_PAGE%  %LINK_PAGE%  %DOWN_PAGE% %END% ');
		$show=$Page->show();
		return array("list"=>$info,"page"=>$show);
	}

	public function getlist1(){
		$page=I("p",1,"int");
		$info=$this->where('payment=0')->page($page.',25')->select();
		$count=$this->where('payment=0')->count();
		$Page=new\Think\Page($count,25);
		$Page->setConfig('header','<div >共<span>%TOTAL_ROW%</span>条&nbsp;&nbsp;第<span>%NOW_PAGE%</span>页/共<span>%TOTAL_PAGE%</span>页&nbsp;&nbsp;每页25条</div>');
		$Page->setConfig('theme','%HEADER% %FIRST% %UP_PAGE% %LINK_PAGE%  %DOWN_PAGE% %END% ');
		$show=$Page->show();
		return array("list"=>$info,"page"=>$show,);
	}

	public function getlist2(){
		$search=I("phone");
		$search=str_replace(' ', '', $search);
		$info['tride_id']=$search;
		$info['payment']=0;
		$info=$this->where($info)->select();
	/*	foreach ($info as $k => $v) {
			if($v['payment']==1){
				$info[$k]['payment']="确认付款";
			}else{
				$info[$k]['payment']="未确认";
			}
		}*/
		return array("list"=>$info);
	}
	public function get_list1(){
		$search=I("phone");
		if(!$search){
			$search=session('payphone');
		}else{
			session('payphone',$search);
		}
		$search=str_replace(' ', '', $search);
		if($search){
			$info1['user']=$search;
		}
		$time=I('time');
		if(!$time){
			$time=session('time');
		}else{
			session('time',$time);
		}
		if($time){
			$info1['stime']=$time;
		}
		
		$info1['payment']=1;
		$page=I("p",1,"int");
		$info=$this->where($info1)->page($page.',25')->select();
		$count=$this->where($info1)->count();
		$Page=new\Think\Page($count,25);
		$Page->lastSuffix=false;
		$Page->setConfig('header','<div >共<span>%TOTAL_ROW%</span>条&nbsp;&nbsp;第<span>%NOW_PAGE%</span>页/共<span>%TOTAL_PAGE%</span>页&nbsp;&nbsp;每页25条</div>');
		$Page->setConfig('prev','');
		$Page->setConfig('next','');
		$Page->setConfig('theme','%HEADER% %FIRST%  %LINK_PAGE% %UP_PAGE% %DOWN_PAGE% %END% ');
		$show=$Page->show();
		return array("list"=>$info,"page"=>$show);
		return array("list"=>$info,"count"=>$count);
	}

}